package util;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: DengJia
 * @Date: 2022/1/26 10:09
 * @Description:
 */

public class MainTest {
    public static void main(String[] args) {
        List<Integer> i1 = new ArrayList<Integer>() {{
            add(1);
            add(2);
            add(3);
            add(4);
        }};
        List<Integer> i2 = new ArrayList<Integer>() {{
            add(3);
            add(4);
            add(5);
            add(6);
        }};

        List<String> s1 = new ArrayList<String>() {{
            add("1001");
            add("1002");
            add("1003");
            add("1004");
        }};
        List<String> s2 = new ArrayList<String>() {{
            add("1003");
            add("1004");
            add("1005");
            add("1006");
        }};

        List<Operation> op1 = new ArrayList<Operation>() {{
            add(new Operation("71.7102", "会阴裂伤缝合术", 999.9));
            add(new Operation("34.9104", "CT引导下胸腔穿刺术", 123.4));
            add(new Operation("63.0102", "附睾活组织检查", 678.9));
        }};
        List<Operation> op2 = new ArrayList<Operation>() {{
            add(new Operation("34.9104", "CT引导下胸腔穿刺术", 123.4));
            add(new Operation("63.0102", "附睾活组织检查", 678.9));
            add(new Operation("48.4905", "Bacon-Black术", 777.7));
        }};

        List<Course> c1 = new ArrayList<Course>() {{
            add(new Course(101, "10100", "数学"));
            add(new Course(102, "10200", "语文"));
            add(new Course(103, "10300", "英语"));
        }};
        List<Course> c2 = new ArrayList<Course>() {{
            add(new Course(102, "10200", "语文"));
            add(new Course(103, "10300", "英语"));
            add(new Course(104, "10400", "物理"));
        }};

        System.out.println(CollectionOpU.diff(i1, i2));
        System.out.println(CollectionOpU.diff(i2, i1));
        System.out.println(CollectionOpU.diff(s1, s2));
        System.out.println(CollectionOpU.diff(s2, s1));


//        System.out.println(CollectionOpU.diff(c1, c2, Course::getId));
//        System.out.println(CollectionOpU.diff(c2, c1, Course::getId));

        System.out.println(CollectionOpU.diff(op1, op2, Operation::getId));
        System.out.println(CollectionOpU.diff(op2, op1, Operation::getId));
    }
}
